Recode usage of FPSR_DEFAULT due to strange double declaration
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Sat, 19 Nov 2005 21:41:08 +0000 (15:41 -0600)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Sat, 19 Nov 2005 21:41:08 +0000 (15:41 -0600)
tools/libxc/xc_ia64_stubs.c
tools/libxc/xc_linux_build.c

index e926c87c333badbfcaef91bb3248e409d6fb2922..4b11af60e447a2ebba35c9f5bbabb64247e00d5f 100644 (file)
@@ -7,6 +7,21 @@
 #include "xen/arch-ia64.h"
 #include <xen/io/ioreq.h>
 
+/* this is a very ugly way of getting FPSR_DEFAULT.  struct ia64_fpreg is
+ * mysteriously declared in two places: /usr/include/asm/fpu.h and
+ * /usr/include/bits/sigcontext.h.  The former also defines FPSR_DEFAULT,
+ * the latter doesn't but is included (indirectly) by xg_private.h */
+#define __ASSEMBLY__
+#include <asm/fpu.h>
+#undef __IA64_UL
+#define __IA64_UL(x)           ((unsigned long)(x))
+#undef __ASSEMBLY__
+                                                                                
+unsigned long xc_ia64_fpsr_default(void)
+{
+        return FPSR_DEFAULT;
+}
+
 int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, 
                   uint32_t max_factor, uint32_t flags)
 {
index 4cc145c9318dc93cd2abd117b6ce456104763763..cb72db04d6424f2f01ba2237a0b1f10ebd10ed0b 100644 (file)
@@ -278,7 +278,8 @@ static int setup_pg_tables_64(int xc_handle, uint32_t dom,
 #endif
 
 #ifdef __ia64__
-#include <asm/fpu.h> /* for FPSR_DEFAULT */
+extern unsigned long xc_ia64_fpsr_default(void);
+
 static int setup_guest(int xc_handle,
                        uint32_t dom,
                        char *image, unsigned long image_size,
@@ -780,7 +781,7 @@ int xc_linux_build(int xc_handle,
     ctxt->regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */
     ctxt->regs.cr_iip = vkern_entry;
     ctxt->regs.cr_ifs = 1UL << 63;
-    ctxt->regs.ar_fpsr = FPSR_DEFAULT;
+    ctxt->regs.ar_fpsr = xc_ia64_fpsr_default();
     /* currently done by hypervisor, should move here */
     /* ctxt->regs.r28 = dom_fw_setup(); */
     ctxt->vcpu.privregs = 0;